function GM:SetPlayerAnimation( pl, anim )
    local wep = tostring(pl:GetActiveWeapon())
    local Speed = pl:GetVelocity():Length()
    local OnGround = pl:OnGround()
   
    // ----------------------------------------------------------
    // IDLE
    // ----------------------------------------------------------
    local anim = "idle_angry"
   
    // ----------------------------------------------------------
    // CROUCHING & NOT MOVING
    // ----------------------------------------------------------
    if ( OnGround && pl:Crouching() ) then
        anim = "Sit_Ground"
    end
    // ----------------------------------------------------------
    // CROUCHING & MOVING
    // ----------------------------------------------------------
    if ( Speed > 0 && OnGround && pl:Crouching() ) then
        anim = "Crouch_walk_all"
    end
   
    // ----------------------------------------------------------
    // RUNNING/WALKING
    // ----------------------------------------------------------
    if (Speed > 0 && OnGround && !pl:Crouching() ) then
        if (Speed > 150) then
            anim = "run_all"
        else
            anim = "walk_all"
        end
    end
 
    // ----------------------------------------------------------
    // JUMPING
    // ----------------------------------------------------------
    if ( !OnGround ) then
        anim = "jump_holding_glide"
    end
   
    // ----------------------------------------------------------
    // TRANSLATION AND UPDATING ANIM
    // ----------------------------------------------------------
    anim = pl:LookupSequence(anim)
    if (pl:GetSequence() == anim) then return end
    pl:SetPlaybackRate( 1.0 )   
    pl:ResetSequence( anim )
    pl:SetCycle( 0 )
   
end 